#!/bin/bash

# Get total memory
total_memory=$(free -m | awk '/^Mem:/ {print $2}')
total_memory_gb=$(echo "scale=2;${total_memory}/1024" | bc)

# Get used memory
used_memory=$(free -m | awk '/^Mem:/ {print $3}')
used_memory_gb=$(echo "scale=2;${used_memory}/1024" | bc)

used_memory_percentage=$((100 * ${used_memory} / ${total_memory}))

echo "Used memory: ${used_memory_percentage}% ${used_memory_gb}GB/${total_memory_gb}GB"

# EOF

